package com.app.babygo;

import com.app.babygo.help.DBChecker;

import android.os.Bundle;
import android.os.CountDownTimer;
import android.app.Activity;
import android.content.Intent;



public class Logo extends Activity {
	protected static final String TAG = "MainLauncher_UI";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_logo);
		
		final Intent intentRegister = new Intent(this, Register.class);
		final Intent intentChildChoose = new Intent(this, ChildChoose.class);
		//display the logo during 5 secondes,
	    new CountDownTimer(2000,1000){
	        @Override
	        public void onTick(long millisUntilFinished){} 
	        @Override
	        public void onFinish(){
	               //set the new Content of your activity
					if (DBChecker.checkDataBase() == true) {
						startActivity(intentChildChoose);
					} else {
						startActivity(intentRegister);
					}
	        }
	   }.start();
	}
	
	protected void onPause() {
		super.onPause();
		finish();
	}
}
